﻿using smp.RabbitMq.Strategies;

namespace smp.RabbitMq
{
    public interface IRabbitMqFactory
    {
        /// <summary>
        /// Create new disposable IPublisher instance
        /// </summary>
        /// <param name="configurationKey">configuration connection key</param>
        /// <returns>new IPublisher instance</returns>
        IPublisher CreatePublisher(string configurationKey);
        /// <summary>
        /// Create new disposable IPublisher instance
        /// </summary>
        /// <param name="configuration">IRabbitMqConfiguration instance</param>
        /// <returns>new IPublisher instance</returns>
        IPublisher CreatePublisher(IRabbitMqConfiguration configuration);

        /// <summary>
        /// Create new disposable IRequester instance
        /// </summary>
        /// <param name="configurationKey">configuration connection key</param>
        /// <returns>new IRequester instance</returns>
        IRequester CreateRequester(string configurationKey);
        /// <summary>
        /// Create new disposable IRequester instance
        /// </summary>
        /// <param name="configuration">IRabbitMqConfiguration instance</param>
        /// <returns>new IRequester instance</returns>
        IRequester CreateRequester(IRabbitMqConfiguration configuration);


        /// <summary>
        /// Create new disposable ISubscriber instance
        /// </summary>
        /// <param name="handlers">Subscriber message handlers</param>
        /// <returns>new ISubscriber instance</returns>
        ISubscriber CreateSubscriber(SubscriberHandlers handlers);
        /// <summary>
        /// Create new disposable ISubscriber instance
        /// </summary>
        /// <param name="handlers">Subscriber message handlers</param>
        /// <param name="strategy">ISubscriberStrategy instance</param>
        /// <returns>new ISubscriber instance</returns>
        ISubscriber CreateSubscriber(SubscriberHandlers handlers, ISubscriberStrategy strategy);
        /// <summary>
        /// Create new disposable ISubscriber instance
        /// </summary>
        /// <param name="handlers">Subscriber message handlers</param>
        /// <param name="configuration">IRabbitMqConfiguration instance</param>
        /// <returns>new ISubscriber instance</returns>
        ISubscriber CreateSubscriber(SubscriberHandlers handlers, IRabbitMqConfiguration configuration);
        /// <summary>
        /// Create new disposable ISubscriber instance
        /// </summary>
        /// <param name="handlers">Subscriber message handlers</param>
        /// <param name="strategy">ISubscriberStrategy instance</param>
        /// <param name="configuration">IRabbitMqConfiguration instance</param>
        /// <returns>new ISubscriber instance</returns>
        ISubscriber CreateSubscriber(SubscriberHandlers handlers, ISubscriberStrategy strategy, IRabbitMqConfiguration configuration);


        /// <summary>
        /// Create new IDisposable IResponderSubscriber
        /// </summary>
        /// <param name="handlers">ResponderSubscriber message handlers</param>
        /// <returns>new IResponderSubscriber instance</returns>
        IResponderSubscriber CreateResponderSubscriber(ResponderHandlers handlers);
        /// <summary>
        /// Create new IDisposable IResponderSubscriber
        /// </summary>
        /// <param name="handlers">ResponderSubscriber message handlers</param>
        /// <param name="strategy">IResponderStrategy instance</param>
        /// <returns>new IResponderSubscriber instance</returns>
        IResponderSubscriber CreateResponderSubscriber(ResponderHandlers handlers, IResponderStrategy strategy);
        /// <summary>
        /// Create new IDisposable IResponderSubscriber
        /// </summary>
        /// <param name="handlers">ResponderSubscriber message handlers</param>
        /// <param name="configuration">IRabbitMqConfiguration instance</param>
        /// <returns>new IResponderSubscriber instance</returns>
        IResponderSubscriber CreateResponderSubscriber(ResponderHandlers handlers, IRabbitMqConfiguration configuration);
        /// <summary>
        /// Create new IDisposable IResponderSubscriber
        /// </summary>
        /// <param name="handlers">ResponderSubscriber message handlers</param>
        /// <param name="strategy">IResponderStrategy instance</param>
        /// <param name="configuration">IRabbitMqConfiguration instance</param>
        /// <returns>new IResponderSubscriber instance</returns>
        IResponderSubscriber CreateResponderSubscriber(ResponderHandlers handlers, IResponderStrategy strategy, IRabbitMqConfiguration configuration);
    }
}
